package com.lcz.authority.common.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lcz.authority.common.annotation.Excel;
import com.lcz.authority.common.domain.BaseEntity;
import com.zhou.starter.jpacomment.annotation.ColumnComment;
import com.zhou.starter.jpacomment.annotation.TableComment;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @author lcz
 * @desc 字典类型表
 * @mail lcz_0130@163.com
 * @date 2024/05/06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_dict_type")
@Table(name = "sys_dict_type")
@Entity
@TableComment("字典类型表")
public class SysDictTypeEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 字典主键
     */
    @Id
    @TableId(type = IdType.ASSIGN_ID)
    @ColumnComment("字典主键")
    private String dictId;

    /**
     * 字典名称
     */
    @NotBlank(message = "字典名称不能为空")
    @Size(max = 100, message = "字典类型名称长度不能超过100个字符")
    @Excel(name = "字典名称")
    @ColumnComment("字典名称")
    private String dictName;

    /**
     * 字典类型
     */
    @NotBlank(message = "字典类型不能为空")
    @Size(max = 100, message = "字典类型类型长度不能超过100个字符")
    @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头，且只能为（小写字母，数字，下滑线）")
    @Excel(name = "字典类型")
    @ColumnComment("字典类型")
    private String dictType;


    /**
     * 状态（0正常 1停用）
     */
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
    @ColumnComment("状态（0正常 1停用）")
    private String status;


    /**
     * 备注
     */
    @ColumnComment("备注")
    private String remark;

}
